package com.xiaodeng.xdblogspringboot.anno;

import com.xiaodeng.xdblogspringboot.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = StateValidation.class)
public @interface State {
    String message() default ("文章状态state只能是公开或者隐藏");
    //指定分组
    Class<?>[] groups() default {};
    //负载，获取state注解的附加信息
    Class<? extends Payload>[] payload() default {};
}
